﻿using System;
using System.Runtime.InteropServices;
namespace Module_Debug.AdbHelp
{
    public static class com_sys_function
    {
        // 声明INI文件的写操作函数 WritePrivateProfileString()
        [DllImport("kernel32")]
        private static extern int WritePrivateProfileString(string section, string key, string val, string filePath);

        // 声明INI文件的读操作函数 GetPrivateProfileString()
        [DllImport("kernel32")]
        private static extern int GetPrivateProfileString(string section, string key, string def, System.Text.StringBuilder retVal, int size, string filePath);

        //写入INI的方法
        public static void ini_file_write(string section, string key, string value, string path)
        {
            WritePrivateProfileString(section, key, value, path);
        }
        //读取INI的方法
        public static string ini_file_read(string section, string key, string path)
        {
            System.Text.StringBuilder temp = new System.Text.StringBuilder(1024);
            GetPrivateProfileString(section, key, "", temp, 1024, path);
            return temp.ToString();
        }
        //获取全局参数路径
        public static string get_current_path()
        {
            return Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\2K_CFG";
        }
    }
    public class com_sys_param
    {
        public int iselect_win;
        public int iselect_page;
        public string str_cmd;
        public bool icheck;
    }
}
